<template>
  <div class="app-header">
    <template v-if="showBack">
      <a class="btn-back" @click="onBack">&lt;</a>
    </template>

    <slot></slot>

    <div v-if="$slots.right" class="right">
      <slot name="right"></slot>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String
    },
    showBack: {
      type: Boolean,
      default: true
    }
  },
  setup(props, { root: { $router } }) {
    function onBack() {
      $router.back();
    }
    return {
      onBack
    };
  }
};
</script>

<style></style>
